<?php

/**
 * This file is part of the Framework03 PHP framework.
 * @author Walter Tamboer
 * @package Framework03
 */

/**
 * The abstract base class for a response to a controller request.
 */
abstract class FW_Controller_Response_Abstract
{
    /**
     * @var FW_Exception An exception that has been set while handling a controller request.
     */
    private $exception = null;
    
    /**
     * Sets an exception that did occur while handling a request.
     * @param FW_Exception $e The exception that did occur.
     * @return FW_Controller_Response_Abstract
     */
    public function setException(FW_Exception $e)
    {
        $this->exception = $e;
        return $this;
    }

    /**
     * Checks if this response has an exception set.
     * @return boolean Returns true when an exception has been set; false otherwise.
     */
    public function hasException()
    {
        return ($this->exception != null);
    }
}
